package cn.mengfly.testnrz;

import cn.mengfly.testnrz.springel.SpElBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author Mengfly
 */
@SpringBootApplication
public class MainApplication implements ApplicationRunner {

    @Autowired
    private SpElBean bean;

    public static void main(String[] args) {
        SpringApplication.run(MainApplication.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        testSpElBean();
    }

    private  void testSpElBean() {
        System.out.println("getAlgDemoValue() : " + bean.getAlgDemoValue());
        System.out.println("getStringConcatValue() : " + bean.getStringConcatValue());
        System.out.println("getRandomInt() : " + bean.getRandomInt());
        bean.showContextVar();
    }
}
